let nums = [0,1,0,3,12]
//必须在不复制数组的情况下原地对数组进行操作
function moveZeroes(nums){
   let pointer = 0
   for(let i = 0;i<nums.length;i++){
    if(nums[i]!==0){
        //交换位置
        [nums[pointer], nums[i]] = [nums[i], nums[pointer]]
        pointer++
    }
   }
}
moveZeroes(nums)
console.log(nums)
